home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / python2.4 / lib-old / find.pyc (.txt) < prev    next >
Python Compiled Bytecode  |  2005-10-18  |  904b  |  38 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.4)
  3.  
  4. import fnmatch
  5. import os
  6. _debug = 0
  7. _prune = [
  8.     '(*)']
  9.  
  10. def find(pattern, dir = os.curdir):
  11.     list = []
  12.     names = os.listdir(dir)
  13.     names.sort()
  14.     for name in names:
  15.         if name in (os.curdir, os.pardir):
  16.             continue
  17.         
  18.         fullname = os.path.join(dir, name)
  19.         if fnmatch.fnmatch(name, pattern):
  20.             list.append(fullname)
  21.         
  22.         if os.path.isdir(fullname) and not os.path.islink(fullname):
  23.             for p in _prune:
  24.                 if fnmatch.fnmatch(name, p):
  25.                     if _debug:
  26.                         print 'skip', `fullname`
  27.                     
  28.                     break
  29.                     continue
  30.             elif _debug:
  31.                 print 'descend into', `fullname`
  32.             
  33.             list = list + find(pattern, fullname)
  34.             continue
  35.     
  36.     return list
  37.  
  38.